cmake_minimum_required(VERSION 3.10)
project(recipe04 VERSION 1.0 LANGUAGES NONE)
SET(MY_VARIABLE "Hello CMake")      # 设置一个字符串变量
SET(SRC_FILES "main.cpp;utils.cpp") # 设置一个列表变量
SET(ENABLE_FEATURE TRUE)            # 设置一个布尔变量

# 设置一个CACHE变量，类型为PATH
SET(INSTALL_PREFIX "/usr/local" CACHE PATH "安装路径")

message(STATUS "MY_VARIABLE: ${MY_VARIABLE}")
message(STATUS "SRC_FILES: ${SRC_FILES}")
message(STATUS "ENABLE_FEATURE: ${ENABLE_FEATURE}")
message(STATUS "INSTALL_PREFIX: ${INSTALL_PREFIX}")

SET(MY_DEFINE "ENABLE_FEATURE")
ADD_DEFINITIONS(-D${MY_DEFINE})  #相当于 -DENABLE_FEATURE